import Vue from 'vue'
import VueRouter from 'vue-router'
import Footer from '@/components/footer.vue'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/guide'
  },
  { // 启动页
    path: '/guide',
    name: 'guide',
    components: {
      default: () => import('@/views/guide/index')
    }
  },
  // 首页--1
  {
    path: '/home',
    name: 'home',
    components: {
      default: () => import('@/views/home/index'),
      footer: Footer
    }
  },
  { // 直播
    path: '/live',
    name: 'live',
    components: {
      default: () => import('@/views/live/index'),
      footer: Footer
    }
  },
  { // 视频详情
    path: '/videoDetail',
    name: 'videoDetail',
    components: {
      default: () => import('@/views/videoDetail/index')
    }
  },
  { // 通知页
    path: '/inform',
    name: 'inform',
    components: {
      default: () => import('@/views/inform/index'),
      footer: Footer
    }
  },
  { // 通知详情页
    path: '/inform/informDetail',
    name: 'informDetail',
    components: {
      default: () => import('@/views/inform/informDetail')
    }
  },
  { // 个人中心页
    path: '/user',
    name: 'user',
    components: {
      default: () => import('@/views/user/index'),
      footer: Footer
    }
  },
  { // 个人--我的点赞页面
    path: '/myLike',
    name: 'myLike',
    components: {
      default: () => import('@/views/user/myLike')
    }
  },
  { // 个人--我的收藏页面
    path: '/myCollection',
    name: 'myCollection',
    components: {
      default: () => import('@/views/user/myCollection')
    }
  },
  { // 个人--我的评论页面
    path: '/myComment',
    name: 'myComment',
    components: {
      default: () => import('@/views/user/myComment')
    }
  },
  { // 个人--我的订单页面
    path: '/myOrder',
    name: 'myOrder',
    components: {
      default: () => import('@/views/user/myOrder')
    }
  },
  { // 订单详情页面
    path: '/orderDetail',
    name: 'orderDetail',
    components: {
      default: () => import('@/views/orderDetail/index')
    }
  },
  { // 客服
    path: '/service',
    name: 'service',
    components: {
      default: () => import('@/views/service/index'),
      footer: Footer
    }
  },
  { // 登录
    path: '/login',
    name: 'login',
    components: {
      default: () => import('@/views/login/index')
    }
  },
  // nav分类--1
  {
    path: '/kind/:type',
    name: 'kind',
    components: {
      default: () => import('@/views/kind/index')
    }
  },
  { // 商品详情页
    path: '/proDetail',
    name: 'proDetail',
    components: {
      default: () => import('@/views/proDetail/index')
    }
  },
  { // 每日福利
    path: '/welfare',
    name: 'welfare',
    components: {
      default: () => import('@/views/everydayWelfare/index')
    }
  },
  { // 每日福利详情
    path: '/welfareDetail',
    name: 'welfareDetail',
    components: {
      default: () => import('@/views/welfareDetail/index')
    }
  },
  { // 医疗百科
    path: '/medical',
    name: 'medical',
    components: {
      default: () => import('@/views/medical/index')
    }
  },
  { // 医疗百科详情
    path: '/medical/medicalPro',
    name: 'medicalPro',
    components: {
      default: () => import('@/views/medical/medicalPro')
    }
  },
  { // 确认订单
    path: '/order',
    name: 'order',
    components: {
      default: () => import('@/views/order/index')
    }
  },
  { // 支付订单
    path: '/payOrder',
    name: 'payOrder',
    components: {
      default: () => import('@/views/payOrder/index')
    }
  },
  { // 支付成功
    path: '/paySucceed',
    name: 'paySucceed',
    components: {
      default: () => import('@/views/paySucceed/index')
    }
  },
  // 推荐详情--1
  {
    path: '/Redetail/:diaryid',
    name: 'Redetail',
    components: {
      default: () => import('@/views/home/Redetail')
    }
  },
  // 首页地址选择--1
  {
    path: '/areaSelect',
    name: 'areaSelect',
    components: {
      default: () => import('@/views/home/areaSelect')
    }
  },
  { // 用户协议
    path: '/userAgreement',
    name: 'userAgreement',
    components: {
      default: () => import('@/views/userAgreement/index')
    }
  },
  { // 中国移动认证服务条款
    path: '/chinaMobileCertification',
    name: 'chinaMobileCertification',
    components: {
      default: () => import('@/views/chinaMobileCertification/index')
    }
  },
  { // 特别说明
    path: '/specialMessage',
    name: 'specialMessage',
    components: {
      default: () => import('@/views/specialMessage/index')
    }
  },
  { // 修改信息
    path: '/changeMsg',
    name: 'changeMsg',
    components: {
      default: () => import('@/views/changeMsg/index')
    }
  },
  // 首页地址选择--1
  {
    path: '/fashion',
    name: 'fashion',
    components: {
      default: () => import('@/views/fashion')
    }
  },
  // 潮流详情--1
  {
    path: '/fashionDetail/:tidewayid',
    name: 'fashionDetail',
    components: {
      default: () => import('@/views/fashion/fashionDetail')
    }
  },
  // 心愿单--1
  {
    path: '/wishList',
    name: 'wishList',
    components: {
      default: () => import('@/views/home/wishList')
    }
  },
  // 搜索--1
  {
    path: '/search',
    name: 'search',
    components: {
      default: () => import('@/views/search')
    }
  },
  // 客服首页--1
  {
    path: '/service',
    name: 'service',
    components: {
      default: () => import('@/views/service')
    }
  },
  // 客服详情--1
  {
    path: '/communication/:servicerid',
    name: 'communication',
    components: {
      default: () => import('@/views/service/communication')
    }
  },
  { // 404页面
    path: '*',
    name: 'notfound',
    component: () => import('@/views/notfound/index.vue')
  }
]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router
